inherited crdAddDogovor2IncAct: TcrdAddDogovor2IncAct
  Left = 356
  Top = 273
  Width = 829
  Height = 517
  BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp]
  Caption = #1044#1086#1073#1072#1074#1083#1077#1085#1080#1077' '#1076#1086#1075#1086#1074#1086#1088#1086#1074' '#1082' '#1072#1082#1090#1091' '#1085#1077#1076#1086#1087#1086#1089#1090#1072#1074#1082#1080
  OldCreateOrder = True
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited ToolBar1: TToolBar [0]
    Width = 821
    Height = 0
    TabOrder = 2
  end
  object pfilter: TPanel [1]
    Left = 559
    Top = 0
    Width = 262
    Height = 463
    Align = alRight
    BevelOuter = bvNone
    TabOrder = 0
    inline fraAddress: TfraAddress
      Left = 0
      Top = 163
      Width = 262
      Height = 200
      Align = alTop
      TabOrder = 1
      inherited SearchBox: TGroupBox
        Width = 262
        Height = 200
        inherited SubPanel: TPanel
          Width = 258
          Height = 183
          inherited Label8: TLabel
            Top = 125
            Caption = #1069#1090#1072#1078
            Visible = True
          end
          inherited Label6: TLabel
            Left = 26
            Top = 218
            Enabled = False
            Visible = False
          end
          inherited Label7: TLabel
            Top = 101
            Caption = #1055#1086#1076#1098#1077#1079#1076
            Visible = True
          end
          inherited Label5: TLabel
            Left = 68
            Top = 243
            Enabled = False
            Visible = False
          end
          inherited Label4: TLabel
            Top = 78
          end
          inherited Label3: TLabel
            Top = 54
          end
          inherited Label2: TLabel
            Top = 30
          end
          inherited Label1: TLabel
            Top = 6
          end
          inherited TownBox: TDBLookupComboboxEh
            Top = 3
          end
          inherited StreetBox: TDBLookupComboboxEh
            Top = 27
          end
          inherited NLSEdit: TDBEditEh
            Left = 100
            Top = 216
            Enabled = False
            Visible = False
          end
          inherited NameEdit: TDBEditEh
            Left = 100
            Top = 240
            Enabled = False
            Visible = False
          end
          inherited HouseBox: TDBLookupComboboxEh
            Top = 51
          end
          inherited FindBtn: TButton
            Left = 30
            Top = 151
            Width = 103
            OnClick = fraAddress1FindBtnClick
          end
          inherited dbn2: TDBNumberEditEh
            Top = 123
            Enabled = True
            Increment = 0.000000000000000000
            Visible = True
          end
          inherited dbn1: TDBNumberEditEh
            Top = 99
            Enabled = True
            Increment = 0.000000000000000000
            MinValue = 1.000000000000000000
            Visible = True
          end
          inherited ClearBtn: TButton
            Left = 152
            Top = 151
            Width = 97
          end
          inherited AppartBox: TDBLookupComboboxEh
            Top = 75
          end
          inherited AddBtn: TButton
            Left = 148
            Top = 224
            Width = 81
            Visible = False
          end
        end
      end
      inherited QStreets: TpFIBDataSet
        Transaction = LocalTrans
        Database = MAINDM.pMainDatabase
        UpdateTransaction = LocalTrans
      end
      inherited QHouses: TpFIBDataSet
        Transaction = LocalTrans
        Database = MAINDM.pMainDatabase
        UpdateTransaction = LocalTrans
      end
      inherited QTowns: TpFIBDataSet
        Transaction = LocalTrans
        Database = MAINDM.pMainDatabase
        UpdateTransaction = LocalTrans
      end
      inherited QApparts: TpFIBDataSet
        Transaction = LocalTrans
        UpdateTransaction = LocalTrans
      end
    end
    object GroupBox1: TGroupBox
      Left = 0
      Top = 0
      Width = 262
      Height = 163
      Align = alTop
      Caption = ' '#1055#1072#1088#1072#1084#1077#1090#1088#1099' '#1072#1082#1090#1072' '
      TabOrder = 0
      object Label6: TLabel
        Left = 26
        Top = 26
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1059#1089#1083#1091#1075#1072
      end
      object Label1: TLabel
        Left = 26
        Top = 50
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1055#1086#1089#1090#1072#1074#1097#1080#1082
      end
      object Label2: TLabel
        Left = 26
        Top = 74
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1059#1095#1072#1089#1090#1086#1082
      end
      object Label3: TLabel
        Left = 8
        Top = 98
        Width = 87
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1046#1080#1083#1080#1097#1085#1072#1103' '#1086#1088#1075'.'
      end
      object dbeService: TDBEditEh
        Left = 104
        Top = 24
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Enabled = False
        Flat = True
        ReadOnly = True
        TabOrder = 0
        Visible = True
      end
      object dbeSupplier: TDBEditEh
        Left = 104
        Top = 48
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DataField = 'SUPPLIER_NAME'
        DataSource = dsc_IncAct
        EditButtons = <>
        Enabled = False
        Flat = True
        ReadOnly = True
        TabOrder = 1
        Visible = True
      end
      object dbeSuppDept: TDBEditEh
        Left = 104
        Top = 72
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DataField = 'SUPPLIER_DEPT_NAME'
        DataSource = dsc_IncAct
        EditButtons = <>
        Enabled = False
        Flat = True
        ReadOnly = True
        TabOrder = 2
        Visible = True
      end
      object dbeManag: TDBEditEh
        Left = 104
        Top = 96
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DataField = 'MANAG'
        DataSource = dsc_IncAct
        EditButtons = <>
        Enabled = False
        Flat = True
        ReadOnly = True
        TabOrder = 3
        Visible = True
      end
      object cbMeter: TDBCheckBoxEh
        Left = 104
        Top = 118
        Width = 97
        Height = 17
        AlwaysShowBorder = True
        Caption = #1087#1086' '#1089#1095#1077#1090#1095#1080#1082#1091
        DataField = 'PMETER'
        DataSource = dsc_IncAct
        Enabled = False
        Flat = True
        ReadOnly = True
        TabOrder = 4
        ValueChecked = '1'
        ValueUnchecked = '0'
      end
      object cbNormativ: TDBCheckBoxEh
        Left = 104
        Top = 138
        Width = 97
        Height = 17
        AlwaysShowBorder = True
        Caption = #1087#1086' '#1085#1086#1088#1084#1072#1090#1080#1074#1091
        DataField = 'PNORM'
        DataSource = dsc_IncAct
        Enabled = False
        Flat = True
        ReadOnly = True
        TabOrder = 5
        ValueChecked = '1'
        ValueUnchecked = '0'
      end
    end
  end
  object PageControl: TPageControl [2]
    Left = 0
    Top = 0
    Width = 559
    Height = 463
    ActivePage = tsDogovorList
    Align = alClient
    Style = tsFlatButtons
    TabOrder = 1
    object tsDogovorList: TTabSheet
      Caption = #1056#1077#1079#1091#1083#1100#1090#1072#1090#1099' '#1087#1086#1080#1089#1082#1072
      object dbgDogovors: TDBGridEh
        Left = 0
        Top = 0
        Width = 551
        Height = 432
        Hint = '(Ctrl + A) '#1042#1099#1076#1077#1083#1080#1090#1100' '#1074#1089#1077
        Align = alClient
        ColumnDefValues.Title.TitleButton = True
        DataGrouping.GroupLevels = <>
        DataSource = dsc_Dogovors
        Flat = True
        FooterColor = clWindow
        FooterFont.Charset = DEFAULT_CHARSET
        FooterFont.Color = clWindowText
        FooterFont.Height = -11
        FooterFont.Name = 'MS Sans Serif'
        FooterFont.Style = []
        Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgRowSelect, dgConfirmDelete, dgCancelOnExit, dgMultiSelect]
        OptionsEh = [dghFixed3D, dghHighlightFocus, dghAutoSortMarking, dghMultiSortMarking, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove]
        ParentShowHint = False
        PopupMenu = pmAppend
        RowDetailPanel.Color = clBtnFace
        ShowHint = True
        SortLocal = True
        TabOrder = 0
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'MS Sans Serif'
        TitleFont.Style = []
        UseMultiTitle = True
        VTitleMargin = 5
        OnSortMarkingChanged = dbgDogovorsSortMarkingChanged
        Columns = <
          item
            EditButtons = <>
            FieldName = 'ID'
            Footers = <>
            Width = 55
          end
          item
            EditButtons = <>
            FieldName = 'ADDRESS'
            Footers = <>
            Width = 196
          end
          item
            EditButtons = <>
            FieldName = 'METER_EXIST'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'DOORWAY'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'FLOOR'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'RNAME'
            Footers = <>
          end>
        object RowDetailData: TRowDetailPanelControlEh
        end
      end
    end
    object tsAppendLog: TTabSheet
      Caption = #1054#1096#1080#1073#1082#1080' '#1087#1086#1076#1082#1083#1102#1095#1077#1085#1080#1103
      ImageIndex = 1
      TabVisible = False
      object dbgAppendLog: TDBGridEh
        Left = 0
        Top = 0
        Width = 477
        Height = 432
        Align = alClient
        DataGrouping.GroupLevels = <>
        DataSource = dsc_Append
        Flat = True
        FooterColor = clWindow
        FooterFont.Charset = DEFAULT_CHARSET
        FooterFont.Color = clWindowText
        FooterFont.Height = -11
        FooterFont.Name = 'MS Sans Serif'
        FooterFont.Style = []
        Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit, dgMultiSelect]
        OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove]
        PopupMenu = pmAppend
        RowDetailPanel.Color = clBtnFace
        TabOrder = 0
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'MS Sans Serif'
        TitleFont.Style = []
        UseMultiTitle = True
        VTitleMargin = 5
        Columns = <
          item
            EditButtons = <>
            FieldName = 'RDOG_ID'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'RADDRESS'
            Footers = <>
          end
          item
            EditButtons = <>
            FieldName = 'RMESSAGE'
            Footers = <>
          end>
        object RowDetailData: TRowDetailPanelControlEh
        end
      end
    end
  end
  inherited Panel1: TPanel [3]
    Top = 463
    Width = 821
    TabOrder = 3
    inherited BitBtn1: TBitBtn
      Left = 622
      Caption = #1044#1086#1073#1072#1074#1080#1090#1100
    end
    inherited BitBtn2: TBitBtn
      Left = 723
    end
  end
  inherited ActionList1: TActionList
    Images = MAIN.ImageList
    Left = 461
    Top = 257
    inherited aSave: TAction
      Caption = #1055#1086#1076#1082#1083#1102#1095#1080#1090#1100
      Hint = #1055#1086#1076#1082#1083#1102#1095#1080#1090#1100' '#1076#1086#1075#1086#1074#1086#1088#1072' '#1082' '#1058#1059
      OnExecute = aSaveExecute
    end
    inherited aCancel: TAction
      Hint = #1054#1090#1084#1077#1085#1080#1090#1100' '#1080#1079#1084#1077#1085#1077#1085#1080#1103' '#1080' '#1074#1099#1081#1090#1080
      OnExecute = aCancelExecute
    end
  end
  inherited PropStorage: TPropStorageEh
    Section = 'crdAddDogovor2IncAct'
    StoredProps.Strings = (
      '<P>.Height'
      '<P>.Left'
      '<P>.PixelsPerInch'
      '<P>.Top'
      '<P>.Width'
      'PageControl.tsAppendLog.dbgAppendLog.<P>.Columns.ColumnsIndex'
      
        'PageControl.tsAppendLog.dbgAppendLog.<P>.Columns.<ForAllItems>.W' +
        'idth'
      'PageControl.tsDogovorList.dbgDogovors.<P>.Columns.ColumnsIndex'
      
        'PageControl.tsDogovorList.dbgDogovors.<P>.Columns.<ForAllItems>.' +
        'Width')
    Left = 427
    Top = 257
  end
  object ds_Dogovors: TpFIBDataSet
    SelectSQL.Strings = (
      'select distinct'
      '    d.id,'
      '    rabon_id,'
      
        '    rtown||'#39', '#39'||rstreet_name||'#39' '#1076'.'#39'||rhouse||coalesce('#39' '#1082'.'#39'||rc' +
        'orps, '#39#39')||coalesce('#39' '#1082#1074'.'#39'||rapparts, '#39#39')||coalesce('#39' '#1083'.'#39'||rlett' +
        'er, '#39#39') as address,'
      '    rname,'
      
        '    (case when exists (select 1 from proc_dogovor_meter_exist (d' +
        '.id, null, :mbdate, :medate)'
      '      where abs(rmeter_exist) = 1)'
      '      then '#39#1059#1089#1090#1072#1085#1086#1074#1083#1077#1085#39' else '#39#1054#1090#1089#1091#1090#1089#1090#1074#1091#1077#1090#39' end) as meter_exist,'
      '    a.doorway,'
      '    a."FLOOR"'
      ''
      'from'
      '    proc_v_abonents(:pnsl,'
      '    :ptown_id,'
      '    :pstreet_id,'
      '    :phouse,'
      '    :papparts,'
      '    :pname,'
      '    :pactive,'
      '    :pcorps,'
      '    :pletter,'
      '    :padd_params) p'
      'join dogovors d on d.abonent_id = p.rabon_id'
      
        '     and exists (select 1 from proc_dogovor_get_status (d.id, :m' +
        'edate) where rstatus > 0)'
      '     and not exists (select 1 from d_inc2dogovors did'
      
        '              where did.dogovor_id = d.id and did.d_inc_act_id =' +
        ' :pact_id)'
      'join services s on s.id = d.service_id'
      
        '     and (coalesce(:pgroup_id, -1) = -1 or s.group_id = :pgroup_' +
        'id)'
      'join abonents a on a.id = p.rabon_id'
      'order by rapparts')
    Transaction = crdIncompleteAct.trUpdate
    Database = MAINDM.pMainDatabase
    Left = 62
    Top = 127
    object ds_DogovorsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_DogovorsRABON_ID: TFIBIntegerField
      FieldName = 'RABON_ID'
    end
    object ds_DogovorsADDRESS: TFIBStringField
      FieldName = 'ADDRESS'
      Size = 357
      EmptyStrToNull = True
    end
    object ds_DogovorsRNAME: TFIBStringField
      FieldName = 'RNAME'
      Size = 255
      EmptyStrToNull = True
    end
    object ds_DogovorsMETER_EXIST: TFIBStringField
      FieldName = 'METER_EXIST'
      Size = 11
      EmptyStrToNull = True
    end
    object ds_DogovorsDOORWAY: TFIBIntegerField
      FieldName = 'DOORWAY'
    end
    object ds_DogovorsFLOOR: TFIBIntegerField
      FieldName = 'FLOOR'
    end
  end
  object dsc_Dogovors: TDataSource
    DataSet = dsm_Dogovors
    Left = 162
    Top = 127
  end
  object LocalTrans: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 380
    Top = 8
  end
  object ds_Append: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    RDOG_ID,'
      '    RADDRESS,'
      '    RMESSAGE'
      'FROM'
      '    PROC_DOGOVORS2INCACT(:PACTINC_ID,'
      '    :PDOGOVOR_LIST,'
      '    :PDELIMITER) ')
    Transaction = crdIncompleteAct.trUpdate
    Database = MAINDM.pMainDatabase
    Left = 62
    Top = 160
    object ds_AppendRDOG_ID: TFIBIntegerField
      DisplayLabel = #1048#1044' '#1076#1086#1075#1086#1074#1086#1088#1072
      FieldName = 'RDOG_ID'
    end
    object ds_AppendRADDRESS: TFIBStringField
      DisplayLabel = #1040#1076#1088#1077#1089
      DisplayWidth = 20
      FieldName = 'RADDRESS'
      Size = 120
      EmptyStrToNull = True
    end
    object ds_AppendRMESSAGE: TFIBStringField
      DisplayLabel = #1054#1087#1080#1089#1072#1085#1080#1077' '#1086#1096#1080#1073#1082#1080
      DisplayWidth = 30
      FieldName = 'RMESSAGE'
      Size = 120
      EmptyStrToNull = True
    end
  end
  object dsc_Append: TDataSource
    DataSet = ds_Append
    Left = 162
    Top = 160
  end
  object dsm_Dogovors: TMemTableEh
    FieldDefs = <>
    IndexDefs = <
      item
        Name = 'dsm_DogovorsIndex1'
        Fields = 'ID'
        Options = [ixPrimary]
      end>
    Params = <>
    StoreDefs = True
    Left = 128
    Top = 127
    object dsm_DogovorsID: TIntegerField
      DisplayLabel = #1048#1044' '#1076#1086#1075#1086#1074#1086#1088#1072
      FieldName = 'ID'
    end
    object dsm_DogovorsRABON_ID: TIntegerField
      DisplayLabel = #1048#1044' '#1072#1073#1086#1085#1077#1085#1090#1072
      FieldName = 'RABON_ID'
    end
    object dsm_DogovorsADDRESS: TStringField
      DisplayLabel = #1040#1076#1088#1077#1089
      DisplayWidth = 40
      FieldName = 'ADDRESS'
      Size = 357
    end
    object dsm_DogovorsRNAME: TStringField
      DisplayLabel = #1060#1048#1054
      DisplayWidth = 25
      FieldName = 'RNAME'
      Size = 255
    end
    object dsm_DogovorsMETER_EXIST: TStringField
      DisplayLabel = #1057#1095#1077#1090#1095#1080#1082
      FieldName = 'METER_EXIST'
      Size = 11
    end
    object dsm_DogovorsDOORWAY: TIntegerField
      DisplayLabel = #1055#1086#1076#1098#1077#1079#1076
      DisplayWidth = 8
      FieldName = 'DOORWAY'
    end
    object dsm_DogovorsFLOOR: TIntegerField
      DisplayLabel = #1069#1090#1072#1078
      DisplayWidth = 5
      FieldName = 'FLOOR'
    end
  end
  object dscm_Dogovors: TDataSetDriverEh
    KeyFields = 'ID'
    ProviderDataSet = ds_Dogovors
    Left = 96
    Top = 127
  end
  object dsm_Append: TMemTableEh
    Params = <>
    DataDriver = dddsm_Append
    Left = 128
    Top = 160
  end
  object dddsm_Append: TDataSetDriverEh
    KeyFields = 'rdog_id'
    ProviderDataSet = ds_Append
    Left = 96
    Top = 160
  end
  object XLSExportFile: TXLSExportFile
    Left = 240
    Top = 93
  end
  object XLSExportDBGridEh: TXLSExportDBGridEh
    XLSExportFile = XLSExportFile
    DBGridEh = dbgAppendLog
    Options = [eoptVisibleOnly]
    Left = 272
    Top = 93
  end
  object SaveXLSDialog: TSaveDialog
    DefaultExt = 'xls'
    Filter = #1060#1072#1081#1083#1099' Excel (*.xls)|*.xls'
    Title = #1042#1099#1073#1086#1088' '#1092#1072#1081#1083#1072' '#1076#1083#1103' '#1074#1099#1075#1088#1091#1079#1082#1080' '#1076#1072#1085#1085#1099#1093
    Left = 240
    Top = 125
  end
  object pmAppend: TPopupMenu
    Images = MAIN.ImageList
    Left = 272
    Top = 125
    object N1: TMenuItem
      Caption = #1042#1099#1075#1088#1091#1079#1080#1090#1100' '#1074' '#1092#1072#1081#1083
      Hint = #1042#1099#1075#1088#1091#1079#1080#1090#1100' '#1089#1087#1080#1089#1086#1082' '#1086#1096#1080#1073#1086#1082' '#1074' Excel'
      ImageIndex = 7
      OnClick = N1Click
    end
    object N2: TMenuItem
      Caption = #1054#1090#1084#1077#1090#1080#1090#1100'/'#1088#1072#1079#1086#1090#1084#1077#1090#1080#1090#1100' '#1074#1089#1077
      ShortCut = 16449
      OnClick = N2Click
    end
  end
  object ds_IncAct: TpFIBDataSet
    SelectSQL.Strings = (
      'select'
      '    v.name as supplier_name,'
      '    rs.name as supplier_dept_name,'
      '    r.manag,'
      '    d.act_no,'
      '    d.pmeter,'
      '    d.pnorm,'
      '    d.bdate,'
      '    d.edate,'
      '    d.supplier_id,'
      '    d.supplier_dept'
      'from d_incomplete_acts d'
      'left join v_supplier v on v.id = d.supplier_id'
      'left join rsupplier_deps rs on rs.id = d.supplier_dept'
      'left join rmanag r on r.id = d.manag_id'
      'where d.id = :pact_id')
    Transaction = crdIncompleteAct.trUpdate
    Database = MAINDM.pMainDatabase
    Left = 730
    Top = 16
    oFetchAll = True
    object ds_IncActMANAG: TFIBStringField
      FieldName = 'MANAG'
      Size = 60
      EmptyStrToNull = True
    end
    object ds_IncActACT_NO: TFIBStringField
      FieldName = 'ACT_NO'
      Size = 30
      EmptyStrToNull = True
    end
    object ds_IncActPMETER: TFIBSmallIntField
      FieldName = 'PMETER'
    end
    object ds_IncActPNORM: TFIBSmallIntField
      FieldName = 'PNORM'
    end
    object ds_IncActBDATE: TFIBDateField
      FieldName = 'BDATE'
    end
    object ds_IncActEDATE: TFIBDateField
      FieldName = 'EDATE'
    end
    object ds_IncActSUPPLIER_NAME: TFIBStringField
      FieldName = 'SUPPLIER_NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object ds_IncActSUPPLIER_DEPT_NAME: TFIBStringField
      FieldName = 'SUPPLIER_DEPT_NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object ds_IncActSUPPLIER_ID: TFIBIntegerField
      FieldName = 'SUPPLIER_ID'
    end
    object ds_IncActSUPPLIER_DEPT: TFIBIntegerField
      FieldName = 'SUPPLIER_DEPT'
    end
  end
  object dsc_IncAct: TDataSource
    DataSet = ds_IncAct
    Left = 766
    Top = 16
  end
end
